//
//  findpasswordViewController.m
//  BAOASystem
//
//  Created by michael on 2018/2/1.
//  Copyright © 2018年 czd. All rights reserved.
//
#import "findpasswordfirstViewController.h"
#import "findpasswordtextViewController.h"
#import "findpasswordemailViewController.h"
#import "findpasswordViewController.h"
#import "OALoginViewController.h"
@interface findpasswordViewController ()

@end

@implementation findpasswordViewController

- (void)viewDidLoad {
    [super viewDidLoad];
      NSDictionary *attributes = [NSDictionary dictionaryWithObjectsAndKeys:

[UIColor whiteColor],NSForegroundColorAttributeName, nil];
 
[self.navigationController.navigationBar setTitleTextAttributes:attributes];
    self.navigationController.navigationBar.barTintColor = [UIColor colorWithHexString:@"0a62ea"];
    self.navigationController.navigationBar.tintColor = [UIColor whiteColor];

    self.title = NSLocalizedString(@"找回密码", nil);
  UIBarButtonItem *item1 = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"返回"]style:UIBarButtonItemStylePlain target:self action:@selector(buttonClick)];
 self.navigationItem.leftBarButtonItem = item1;
    self.view.backgroundColor = [UIColor colorWithHexString:@"f0eff5"];
    [self initview];

    // Do any additional setup after loading the view from its nib.
}
- (void)initview{
UIButton *emailbutton = [UIButton buttonWithType:UIButtonTypeCustom];
emailbutton.frame = CGRectMake(KScreenWidth/2-80-20, 100, 80, 80);
[emailbutton setTitle:NSLocalizedString(@"邮箱找回", nil) forState: UIControlStateNormal];
[emailbutton setImage:[UIImage imageNamed:NSLocalizedString(@"邮箱找回", nil)] forState:UIControlStateNormal];
[emailbutton setTitle:[NSString stringWithFormat:@"    %@",NSLocalizedString(@"邮箱找回", nil)] forState: UIControlStateNormal];
 [emailbutton layoutButtonWithEdgeInsetsStyle:MKButtonEdgeInsetsStyleTop
                                    imageTitleSpace:20];
// [emailbutton setImageEdgeInsets:UIEdgeInsetsMake(0, -5, 0,5)];
 [emailbutton setTitleColor:[UIColor colorWithHexString:@"484848"]forState:UIControlStateNormal];
    emailbutton.titleLabel.font = [UIFont systemFontOfSize: 14.0];

 [emailbutton addTarget:self action:@selector(emailaction) forControlEvents:UIControlEventTouchUpInside];

[self.view addSubview:emailbutton];

UIButton *textbutton = [UIButton buttonWithType:UIButtonTypeCustom];
textbutton.frame = CGRectMake(KScreenWidth/2+20, 100, 80, 80);
[textbutton setTitle:[NSString stringWithFormat:@"    %@",NSLocalizedString(@"短信找回", nil)] forState: UIControlStateNormal];
[textbutton setImage:[UIImage imageNamed:NSLocalizedString(@"短信找回", nil)] forState:UIControlStateNormal];
 [textbutton layoutButtonWithEdgeInsetsStyle:MKButtonEdgeInsetsStyleTop
                                    imageTitleSpace:20];
 [textbutton setTitleColor:[UIColor colorWithHexString:@"484848"]forState:UIControlStateNormal];
    textbutton.titleLabel.font = [UIFont systemFontOfSize: 14.0];

 [textbutton addTarget:self action:@selector(textaction) forControlEvents:UIControlEventTouchUpInside];

[self.view addSubview:textbutton];

}
- (void)emailaction{
findpasswordfirstViewController *vc = [[findpasswordfirstViewController alloc]init];
vc.type = @"email";
//findpasswordemailViewController *vc= [[findpasswordemailViewController alloc]init];
[self.navigationController pushViewController:vc animated:YES];
}
- (void)textaction{
findpasswordfirstViewController *vc = [[findpasswordfirstViewController alloc]init];
//findpasswordtextViewController *vc= [[findpasswordtextViewController alloc]init];
vc.type = @"text";
[self.navigationController pushViewController:vc animated:YES];

}
- (void)buttonClick{

      UIStoryboard * storyBoard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];

        OALoginViewController * loginVC = [storyBoard instantiateViewControllerWithIdentifier:@"LoginVC"];
        UINavigationController * navVC = [[UINavigationController alloc]initWithRootViewController:loginVC];
    self.view.window.rootViewController = navVC;
        loginVC.navigationController.navigationBar.hidden = YES;
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
